Skip to content

test(mcp-test): deflake streamable HTTP version-negotiation integration test - #1113

Open
slachiewicz wants to merge 1 commit into
modelcontextprotocol:mainfrom
slachiewicz:test/negotiation-test-deflake
Open

test(mcp-test): deflake streamable HTTP version-negotiation integration test#1113
slachiewicz wants to merge 1 commit into
modelcontextprotocol:mainfrom
slachiewicz:test/negotiation-test-deflake

Conversation

@slachiewicz

Copy link
Copy Markdown
Contributor

Two independent timing hazards cause intermittent CI failures:

  1. contextExtractor NPE — Map.of rejects null values while MCP-Protocol-Version is legitimately absent on initialize requests
  2. GET /mcp stream opens asynchronously post-initialize; immediate assertion raced it ('Expected size: 3 but was: 2', e.g. actions/run/33069467622 Jackson 2 job)

Change: null-safe extractor (Objects.requireNonNullElse) + Awaitility guard for the recorded GET.
Tested: ./mvnw -pl mcp-test -am test -Dtest=HttpClientStreamableHttpVersionNegotiationIntegrationTests → 2/2 green; no production code touched.

…on test

- tolerate an absent MCP-Protocol-Version header in the context extractor: Map.of rejects null values while spec-correct clients legitimately omit the header on initialize requests

- await the asynchronously opened GET /mcp stream before asserting recorded calls; observed intermittently in CI as AssertionError Expected size: 3 but was: 2 (evidence: actions/run/33069467622 Jackson 2 Integration Tests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant